<!--
 * @Author: 周凯
 * @Date: 2020-11-04 21:12:51
 * @LastEditTime: 2020-11-04 21:34:09
--> 
<template>
<div>
  <el-table-column :prop="prop" width="180">
    <template slot="header" slot-scope="scope">
      {{title}}
      <el-dropdown v-if="list && list.length>0 && status" @command="command">
        <span class="el-dropdown-link">
          <img slot="reference" class="images" src="/筛选.png" alt="">
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item :command="`${prop}-${item.value}`" v-for="(item,index) in list" :key="index">{{item.label}}</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>

    </template>
  </el-table-column>

</div>
</template>

<script>
export default {
  props: ["status", "title", "prop", "list"],
  methods: {
    command(val) {
      this.$emit('change', val)
    }
  }
}
</script>

<style>
.images {
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

.images:hover {
  cursor: pointer;
}
</style>
